//
//  Message2TableViewCell.m
//  享动
//
//  Created by 沈浩hh on 16/4/7.
//  Copyright © 2016年 HHUI. All rights reserved.
//

#import "Message2TableViewCell.h"
@interface Message2TableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *detailsLabel;
@property (weak, nonatomic) IBOutlet UILabel *title;

@property (weak, nonatomic) IBOutlet UIImageView *icon;

@property (weak, nonatomic) IBOutlet UILabel *type;

@end
@implementation Message2TableViewCell

- (void)setModel:(Message2Model *)model
{
    
    if (KHEIGHT == 568) {
        _title.font = [UIFont systemFontOfSize:14];
        _detailsLabel.font = [UIFont systemFontOfSize:12];
    } else if (KHEIGHT == 480) {
        _title.font = [UIFont systemFontOfSize:12];
        _detailsLabel.font = [UIFont systemFontOfSize:11];
    } else if (KHEIGHT == 736) {
        _title.font = [UIFont systemFontOfSize:16];
        _detailsLabel.font = [UIFont systemFontOfSize:14];
        _type.font = [UIFont systemFontOfSize:11];
    }
    _title.text = model.title;
    _detailsLabel.text = model.sub_title;
    int a = [model.view_cnt intValue];
    if (a >= 10000) {
        _type.text = [NSString stringWithFormat:@"%d.%02d万", a / 10000, a % 10000 / 100];
    } else{
        _type.text = model.view_cnt;

    }
    
    [_icon sd_setImageWithURL:[NSURL URLWithString:model.cover_img]];
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
